package com.rec.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.rec.entity.Memberships;

public interface MembershipsRepository extends JpaRepository<Memberships, Integer>,
JpaSpecificationExecutor<Memberships> {
	
	
	
	@Modifying
	@Query(value="update memberships m set m.department = :department,m.specialty = :specialty,m.degree =:degree where m.id = :id",nativeQuery = true)
	Integer updateMem(
			@Param("id")Integer id,
			@Param("department")String department, 
			@Param("specialty")String specialty, 
			@Param("degree")String degree);
		
}
